Kanzi 4.0.0-beta2
kanzi::Renderer Class Reference

Kanzi legacy renderer interface. More...

#include <kanzi/core.ui/graphics/renderer.hpp>

Classes

struct  RendererSettings
 Settings structure for renderer construction. More...
 

Public Types

enum  Information {
  InformationGLVendor , InformationGLRenderer , InformationGLVersion , InformationGLShadingLanguageVersion ,
  InformationGLExtensions , InformationFormatSupport , InformationShaderBinarySupport , InformationProgramBinarySupport ,
  InformationFeatureSupport , InformationImplementationDependent , InformationDebug , InformationBackend ,
  InformationSurface , InformationAll
}
 
using OverrideMaterialCallback
 Callback function for override materials.
 
enum  Workaround {
  WorkaroundTegra3ColorBufferHalfFloat , WorkaroundAdreno330ColorBufferHalfFloat , WorkaroundChromiumTextureImageUnitCount , WorkaroundAMDCompressedTexStorage ,
  WorkaroundPVRVFrameOESEGLImageExternal , WorkaroundPVRVFrameDepth32f , WorkaroundVivanteDepth32f , WorkaroundFaultyRequiredInternalformat ,
  WorkaroundVmware , WorkaroundWaylandColorBufferFloatHalfFloat , WorkaroundCount
}
 

Public Member Functions

void advanceGlobalTime (chrono::milliseconds deltaTime)
 Advances the renderer wall clock with time delta.
 
void applyCameraMatrix (Matrix4x4 cameraProjectionMatrix, Matrix4x4 cameraViewMatrix, float near, float far)
 Applies camera matrices to the renderer so that Kanzi can apply them as uniforms to shaders.
 
void beginFrame ()
 Begins rendering a frame, that is, clears per-frame variables.
 
void calculateProjectionCameraWorldMatrix ()
 Calculates projection * camera * world matrix.
 
voidcreateImageObject (void *dataPointer, int target, int *attributes)
 Creates an image object, returns NULL if no hardware support.
 
void deleteImageObject (void *imageObject)
 Deletes an image object created with createImageObject.
 
void disableSubRectangleProjection ()
 Disables the sub-rectangle of projection.
 
void disableWorkaround (Workaround workaround)
 Disables a renderer workaround.
 
void enableWorkaround (Workaround workaround)
 Enables a renderer workaround.
 
void endFrame ()
 Ends rendering a frame, that is, increments frame count.
 
GraphicsFormat findValidTextureFormat (GraphicsFormat format, unsigned int features) const
 Finds a valid texture format that is supported by the graphics adapter and is compatible with a given graphics format.
 
void flush () const
 Flushes the GPU pipeline, forces all commands to be executed in finite time.
 
SurfaceColorSpace getActiveColorSpace () const
 Gets the active color space.
 
GraphicsOutputgetActiveGraphicsOutput () const
 Gets the active graphics output from the renderer.
 
template<typename Interface >
InterfacegetActiveGraphicsOutput () const
 Gets the active graphics output from the renderer.
 
float getActiveScalar (GraphicsScalar scalar) const
 Returns a current scalar value from renderer.
 
SurfaceClientAPI getActiveSurfaceClientAPI () const
 
BlendStateCachegetBlendStateCache ()
 Gets the blend state cache.
 
ColorWorkflow getColorWorkflow () const
 Gets the currently configured ColorWorkflow.
 
CommandRecordergetCommandRecorder ()
 Gets the command recorder.
 
CompositionStackgetCompositionStack ()
 Returns the render context stack.
 
GraphicsFormat getDepthStencilFormatForRenderbuffer (bool depth, bool stencil) const
 Returns a depth-stencil renderbuffer format that is supported by the renderer.
 
GraphicsFormat getDepthStencilFormatForTexture (bool depth, bool stencil) const
 Returns a depth-stencil texture format that is supported by the renderer.
 
DepthStencilStateCachegetDepthStencilStateCache ()
 Gets the depth stencil state cache.
 
DrawBuffers getDrawBuffersSupport () const
 Returns the support for draw buffers.
 
bool getDumpStateOnDrawCalls () const
 Returns current dump state on draw calls setting.
 
GraphicsFormat getFallback (GraphicsFormat format, unsigned int usageFlags) const
 Returns a fallback graphics format that supports given usage flags.
 
GraphicsFormatFeature getFeatures (GraphicsFormat format) const
 Describes the features for which a format can be used in the renderer.
 
FloatTexture getFloatTextureSupport () const
 Returns the support for float texture format.
 
int getGlesVersion () const
 Returns the supported OpenGL ES version.
 
chrono::milliseconds getGlobalTime () const
 Gets the wall clock time in milliseconds since program start.
 
HalfFloatTexture getHalfFloatTextureSupport () const
 Returns the support for half float texture format.
 
float getInheritedAspectRatioMultiplier () const
 Gets the multiplier to inherited aspect ratio.
 
const optional< gfx::Statistics::Results > & getLastFrameStatistics ()
 Gets the Kanzi graphics statistics for the previous frame.
 
bool getLogging () const
 Returns whether the logging of OpenGL API calls is enabled.
 
Matrix4x4 getMatrix (FixedMatrix matrixType) const
 Gets a matrix from the renderer.
 
float getMaximumAnisotropy () const
 Gets the maximum anisotropy.
 
size_t getMaximumRenderbufferSize () const
 Gets maximum renderbuffer size.
 
size_t getMaximumSampleCount () const
 Gets maximum sample count for multisampling.
 
size_t getMaximumTextureSize (TextureType textureType) const
 Gets maximum texture side size.
 
size_t getMaximumViewportHeight () const
 Gets maximum viewport height.
 
size_t getMaximumViewportWidth () const
 Gets maximum viewport width.
 
Multisample getMultisampleSupport () const
 Returns the support for multisample textures and renderbuffers.
 
GraphicsFormat getNativePixelReadFormat ()
 Gets the native pixel read format from the renderer.
 
MaterialSharedPtr getOverrideClusterMaterial (Node *node, MaterialSharedPtr clusterMaterial, size_t clusterIndex) const
 Gets overriding material for given transformed object node and cluster material.
 
OverrideMaterialCallback getOverrideMaterialCallback () const
 Gets override material callback from renderer or nullptr if not enabled.
 
voidgetOverrideMaterialCallbackUserData () const
 Gets override material callback user data from renderer.
 
ProgramBinary getProgramBinarySupport () const
 Returns the support for program binaries.
 
RasterStateCachegetRasterStateCache ()
 Gets the raster state cache.
 
RenderPassArchetypeCachegetRenderPassArchetypeCache ()
 Gets the render pass archetype cache.
 
SamplerCachegetSamplerCache ()
 Gets the sampler cache.
 
Vector2 getScreenSize ()
 Gets the current screen size.
 
VertexInputStateCachegetVertexInputStateCache ()
 Gets the vertex input state cache.
 
bool GPUCallsIsEnabled () const
 Returns whether GPU calls are enabled.
 
void initialize (const RendererSettings &rendererSettings)
 Initializes the renderer object.
 
void invalidateAllocations ()
 Invalidates all handles from the renderer without affecting the GL state.
 
bool isHalfFloatVertexAttributeSupported () const
 Returns whether half-float vertex attribute is supported.
 
bool isInitialized () const
 Returns whether the renderer is initialized.
 
bool isSupported (RendererSupport feature) const
 Returns whether coverage buffer is supported.
 
bool isWorkaroundEnabled (Workaround workaround) const
 Return whether a workaround is enabled.
 
void logOpenGLInformation (unsigned int flags) const
 Logs information about renderer capabilities.
 
 Renderer ()
 Creates a renderer object.
 
void reset ()
 Resets the renderer.
 
void resetActiveFramebuffer ()
 Resets the active framebuffer for the renderer to the default (screen).
 
void resetFrame ()
 Resets the frame for the core renderer, that is, counters for logging rendering information, such as triangle count.
 
void setActiveGraphicsOutput (GraphicsOutput *graphicsOutput)
 Sets the active surface context for the renderer.
 
void setActiveScalar (GraphicsScalar scalar, float value)
 Switches an scalar value for renderer if necessary, e.g. depth clear value.
 
void setColorWorkflow (ColorWorkflow colorWorkflow)
 Sets the ColorWorkflow that has been configured.
 
void setGPUCallsEnabled (bool enabled)
 Sets GPU calls as enabled or disabled.
 
void setImageTargetTexture (TextureType type, void *imageObject)
 Sets an image object bound to the currently bound texture type.
 
void setLogging (bool enabled, bool dumpStateOnDrawCalls)
 Enables or disables the logging of OpenGL API calls.
 
void setMatrix (FixedMatrix matrixType, Matrix4x4 matrix)
 Sets a matrix for the renderer.
 
void setOverrideMaterial (MaterialSharedPtr material)
 Sets the current override material that Kanzi uses instead of all default materials.
 
void setOverrideMaterialCallback (OverrideMaterialCallback callbackFunction, void *userData)
 Sets override material callback.
 
void setScreenSize (Vector2 screenSize)
 Sets the current screen size.
 
void setSubRectangleProjection (RectangleFloat subRectangle)
 Enables sub-rectangle of what would be the normal projection with the given relative parameters.
 
void setWorkaroundEnable (Workaround workaround, bool enabled)
 Sets workaround enable state to true or false.
 
bool supports (GraphicsFormat format, unsigned int features) const
 Returns whether a graphics format supports given features.
 
bool supportsColorAttachment (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a color attachment in framebuffers.
 
bool supportsDepthStencilAttachment (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a depth-stencil attachment in framebuffers.
 
bool supportsRenderbuffer (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a renderbuffer.
 
bool supportsTexture (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a texture.
 
void uninitialize ()
 Uninitializes the renderer object.
 
 ~Renderer ()
 

Detailed Description

Kanzi legacy renderer interface.

This class is gradually deprecated in favor of kzgfx rendering. The class still serves as a container for CompositionStack and CommandRecorder.

Since
Kanzi 4.0.0 Removed resolveMultisample functions.

Member Typedef Documentation

◆ OverrideMaterialCallback

Callback function for override materials.

Member Enumeration Documentation

◆ Information

Enumerator
InformationGLVendor 
InformationGLRenderer 
InformationGLVersion 
InformationGLShadingLanguageVersion 
InformationGLExtensions 
InformationFormatSupport 
InformationShaderBinarySupport 
InformationProgramBinarySupport 
InformationFeatureSupport 
InformationImplementationDependent 
InformationDebug 
InformationBackend 
InformationSurface 
InformationAll 

◆ Workaround

Enumerator
WorkaroundTegra3ColorBufferHalfFloat 

Enables color buffer half float on Tegra 3.

WorkaroundAdreno330ColorBufferHalfFloat 

Enables color buffer half float on Adreno 330.

WorkaroundChromiumTextureImageUnitCount 

VirtualBox/Chromium incorrectly reports the number of image units.

WorkaroundAMDCompressedTexStorage 

Disables tex storage.

WorkaroundPVRVFrameOESEGLImageExternal 

Disables OES_EGL_image_external.

WorkaroundPVRVFrameDepth32f 

Disables 32f depth buffer format.

WorkaroundVivanteDepth32f 

Disables 32f depth buffer format.

WorkaroundFaultyRequiredInternalformat 

Disables GL_OES_required_internalformat when vendor is known to have drivers with related issues.

WorkaroundVmware 

Disables GraphicsFormatFeatureColorAttachment when using GraphicsFormatR8G8B8_SRGB.

Also disables TextureTest.testSamplerMinification as it does not work correctly in VMware.

WorkaroundWaylandColorBufferFloatHalfFloat 

Disables color buffer float and half float on Wayland.

WorkaroundCount 

Constructor & Destructor Documentation

◆ Renderer()

kanzi::Renderer::Renderer ( )
explicit

Creates a renderer object.

◆ ~Renderer()

kanzi::Renderer::~Renderer ( )

Member Function Documentation

◆ resetFrame()

void kanzi::Renderer::resetFrame ( )

Resets the frame for the core renderer, that is, counters for logging rendering information, such as triangle count.

◆ reset()

void kanzi::Renderer::reset ( )

Resets the renderer.

Kanzi calls this function when the renderer is initialized. For example, this function resets the caches and states of the renderer, and syncs the renderer variables with the GL states.

This function is very slow. Instead of calling this function, use the Kanzi rendering functions whenever possible. If you do rendering without calling the Kanzi rendering functions, you can use this function to sync the Kanzi rendering state with the GPU state.

◆ initialize()

void kanzi::Renderer::initialize ( const RendererSettings & rendererSettings)

Initializes the renderer object.

Requires a graphics context.

Parameters
rendererSettingsSettings structure for initializing the renderer.

◆ uninitialize()

void kanzi::Renderer::uninitialize ( )

Uninitializes the renderer object.

◆ isInitialized()

bool kanzi::Renderer::isInitialized ( ) const

Returns whether the renderer is initialized.

Returns
If the renderer is initialized, true, otherwise false.

◆ setActiveGraphicsOutput()

void kanzi::Renderer::setActiveGraphicsOutput ( GraphicsOutput * graphicsOutput)

Sets the active surface context for the renderer.

Parameters
graphicsOutputThe graphics output to use.
Since
Kanzi 4.0.0

◆ getActiveGraphicsOutput() [1/2]

GraphicsOutput * kanzi::Renderer::getActiveGraphicsOutput ( ) const

Gets the active graphics output from the renderer.

Returns
The active graphics output.
Since
Kanzi 4.0.0

◆ getActiveGraphicsOutput() [2/2]

template<typename Interface >
Interface * kanzi::Renderer::getActiveGraphicsOutput ( ) const
inline

Gets the active graphics output from the renderer.

Template Parameters
InterfaceInterface of the graphics output to query.
Returns
The active graphics output, or nullptr if the interface is not supported.
Since
Kanzi 4.0.0

◆ getActiveSurfaceClientAPI()

SurfaceClientAPI kanzi::Renderer::getActiveSurfaceClientAPI ( ) const

◆ getActiveColorSpace()

SurfaceColorSpace kanzi::Renderer::getActiveColorSpace ( ) const

Gets the active color space.

Returns
The currently active color space.

◆ setActiveScalar()

void kanzi::Renderer::setActiveScalar ( GraphicsScalar scalar,
float value )

Switches an scalar value for renderer if necessary, e.g. depth clear value.

◆ getActiveScalar()

float kanzi::Renderer::getActiveScalar ( GraphicsScalar scalar) const
inline

Returns a current scalar value from renderer.

◆ setMatrix()

void kanzi::Renderer::setMatrix ( FixedMatrix matrixType,
Matrix4x4 matrix )

Sets a matrix for the renderer.

◆ getMatrix()

Matrix4x4 kanzi::Renderer::getMatrix ( FixedMatrix matrixType) const
inline

Gets a matrix from the renderer.

◆ calculateProjectionCameraWorldMatrix()

void kanzi::Renderer::calculateProjectionCameraWorldMatrix ( )

Calculates projection * camera * world matrix.

◆ resetActiveFramebuffer()

void kanzi::Renderer::resetActiveFramebuffer ( )

Resets the active framebuffer for the renderer to the default (screen).

◆ getNativePixelReadFormat()

GraphicsFormat kanzi::Renderer::getNativePixelReadFormat ( )

Gets the native pixel read format from the renderer.

◆ flush()

void kanzi::Renderer::flush ( ) const

Flushes the GPU pipeline, forces all commands to be executed in finite time.

◆ setGPUCallsEnabled()

void kanzi::Renderer::setGPUCallsEnabled ( bool enabled)

Sets GPU calls as enabled or disabled.

◆ GPUCallsIsEnabled()

bool kanzi::Renderer::GPUCallsIsEnabled ( ) const

Returns whether GPU calls are enabled.

Returns
If GPU calls are enabled, true, otherwise false.

◆ isSupported()

bool kanzi::Renderer::isSupported ( RendererSupport feature) const

Returns whether coverage buffer is supported.

Parameters
featureFeature to check.
Returns
If the feature is supported, true, otherwise false.

◆ getMultisampleSupport()

Multisample kanzi::Renderer::getMultisampleSupport ( ) const

Returns the support for multisample textures and renderbuffers.

Returns
Multisampling support enum.

◆ getProgramBinarySupport()

ProgramBinary kanzi::Renderer::getProgramBinarySupport ( ) const

Returns the support for program binaries.

Returns
Program binary support enum.

◆ getHalfFloatTextureSupport()

HalfFloatTexture kanzi::Renderer::getHalfFloatTextureSupport ( ) const

Returns the support for half float texture format.

Returns
Half float texture support enum.

◆ isHalfFloatVertexAttributeSupported()

bool kanzi::Renderer::isHalfFloatVertexAttributeSupported ( ) const
inline

Returns whether half-float vertex attribute is supported.

Returns
If half-float vertex attribute is supported, true, otherwise false.

◆ getFloatTextureSupport()

FloatTexture kanzi::Renderer::getFloatTextureSupport ( ) const

Returns the support for float texture format.

Returns
Float texture support enum.

◆ getDrawBuffersSupport()

DrawBuffers kanzi::Renderer::getDrawBuffersSupport ( ) const

Returns the support for draw buffers.

Returns
Draw buffers support enum.

◆ createImageObject()

void * kanzi::Renderer::createImageObject ( void * dataPointer,
int target,
int * attributes )

Creates an image object, returns NULL if no hardware support.

Image object can be bound as texture input. Requires surface to be set for the renderer via setSurface, otherwise throws an error.

◆ deleteImageObject()

void kanzi::Renderer::deleteImageObject ( void * imageObject)

Deletes an image object created with createImageObject.

◆ setImageTargetTexture()

void kanzi::Renderer::setImageTargetTexture ( TextureType type,
void * imageObject )

Sets an image object bound to the currently bound texture type.

◆ getMaximumAnisotropy()

float kanzi::Renderer::getMaximumAnisotropy ( ) const

Gets the maximum anisotropy.

Returns
the maximum anisotropy.

◆ getMaximumTextureSize()

size_t kanzi::Renderer::getMaximumTextureSize ( TextureType textureType) const

Gets maximum texture side size.

Returns
The maximum size of a texture side.
Since
Kanzi 4.0.0 changed the type of the return value to size_t.

◆ getMaximumRenderbufferSize()

size_t kanzi::Renderer::getMaximumRenderbufferSize ( ) const

Gets maximum renderbuffer size.

Returns
The maximum size of the renderbuffer.
Since
Kanzi 4.0.0 changed the type of the return value to size_t.

◆ getMaximumViewportWidth()

size_t kanzi::Renderer::getMaximumViewportWidth ( ) const

Gets maximum viewport width.

Returns
The maximum width of the viewport.
Since
Kanzi 4.0.0 changed the type of the return value to size_t.

◆ getMaximumViewportHeight()

size_t kanzi::Renderer::getMaximumViewportHeight ( ) const

Gets maximum viewport height.

Returns
The maximum height of the viewport.
Since
Kanzi 4.0.0 changed the type of the return value to size_t.

◆ getMaximumSampleCount()

size_t kanzi::Renderer::getMaximumSampleCount ( ) const

Gets maximum sample count for multisampling.

Returns
The maximum number of multisampling samples.
Since
Kanzi 4.0.0 changed the type of the return value to size_t.

◆ invalidateAllocations()

void kanzi::Renderer::invalidateAllocations ( )

Invalidates all handles from the renderer without affecting the GL state.

◆ logOpenGLInformation()

void kanzi::Renderer::logOpenGLInformation ( unsigned int flags) const

Logs information about renderer capabilities.

◆ enableWorkaround()

void kanzi::Renderer::enableWorkaround ( Workaround workaround)
inline

Enables a renderer workaround.

◆ disableWorkaround()

void kanzi::Renderer::disableWorkaround ( Workaround workaround)
inline

Disables a renderer workaround.

◆ isWorkaroundEnabled()

bool kanzi::Renderer::isWorkaroundEnabled ( Workaround workaround) const
inline

Return whether a workaround is enabled.

◆ setWorkaroundEnable()

void kanzi::Renderer::setWorkaroundEnable ( Workaround workaround,
bool enabled )
inline

Sets workaround enable state to true or false.

◆ findValidTextureFormat()

GraphicsFormat kanzi::Renderer::findValidTextureFormat ( GraphicsFormat format,
unsigned int features ) const

Finds a valid texture format that is supported by the graphics adapter and is compatible with a given graphics format.

The returned format must be binary-compatible with the format parameter. For example, input ETC1 format can return ETC2 format.

Parameters
formatThe format with which the result format should be compatible.
featuresUsage bits that should be supported by the format.
Returns
A format that is compatible with the requested format or, if no such format exists, kanzi::GraphicsFormatNone.

◆ getFeatures()

GraphicsFormatFeature kanzi::Renderer::getFeatures ( GraphicsFormat format) const

Describes the features for which a format can be used in the renderer.

Parameters
formatThe graphics format.
Returns
The feature flags supported by the graphics format.
Since
Kanzi 4.0.0 changes the return type to GraphicsFormatFeature.

◆ supports()

bool kanzi::Renderer::supports ( GraphicsFormat format,
unsigned int features ) const

Returns whether a graphics format supports given features.

Returns
If the format supports the features, true, otherwise false.

◆ supportsTexture()

bool kanzi::Renderer::supportsTexture ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a texture.

Returns
If the renderer can use the format as a texture, true, otherwise false.

◆ supportsRenderbuffer()

bool kanzi::Renderer::supportsRenderbuffer ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a renderbuffer.

Returns
If the renderer can use the format as a renderbuffer, true, otherwise false.

◆ supportsColorAttachment()

bool kanzi::Renderer::supportsColorAttachment ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a color attachment in framebuffers.

Returns
If the renderer can use the format as a color attachment in framebuffers, true, otherwise false.

◆ supportsDepthStencilAttachment()

bool kanzi::Renderer::supportsDepthStencilAttachment ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a depth-stencil attachment in framebuffers.

Returns
If the renderer can use the format as a depth-stencil attachment in framebuffers, true, otherwise false.

◆ getFallback()

GraphicsFormat kanzi::Renderer::getFallback ( GraphicsFormat format,
unsigned int usageFlags ) const

Returns a fallback graphics format that supports given usage flags.

Returns
The fallback format.

◆ getDepthStencilFormatForRenderbuffer()

GraphicsFormat kanzi::Renderer::getDepthStencilFormatForRenderbuffer ( bool depth,
bool stencil ) const

Returns a depth-stencil renderbuffer format that is supported by the renderer.

Returns
The depth-stencil renderbuffer format.

◆ getDepthStencilFormatForTexture()

GraphicsFormat kanzi::Renderer::getDepthStencilFormatForTexture ( bool depth,
bool stencil ) const

Returns a depth-stencil texture format that is supported by the renderer.

Returns
The depth-stencil texture format.

◆ advanceGlobalTime()

void kanzi::Renderer::advanceGlobalTime ( chrono::milliseconds deltaTime)

Advances the renderer wall clock with time delta.

Parameters
deltaTimeWall clock delta time.

◆ getGlobalTime()

chrono::milliseconds kanzi::Renderer::getGlobalTime ( ) const

Gets the wall clock time in milliseconds since program start.

This time is monotonically increasing and not affected by time zone changes.

Returns
Global time in milliseconds.

◆ getGlesVersion()

int kanzi::Renderer::getGlesVersion ( ) const

Returns the supported OpenGL ES version.

The version is encoded into an integer using this formula: major version times 100 plus minor version times ten. For example, value 310 means version 3.1.

Returns
OpenGL ES version number encoded to an integer using the formula "major version times 100 plus minor version times ten".

◆ getLogging()

bool kanzi::Renderer::getLogging ( ) const

Returns whether the logging of OpenGL API calls is enabled.

Returns
If logging is enabled, true, otherwise false.

◆ getDumpStateOnDrawCalls()

bool kanzi::Renderer::getDumpStateOnDrawCalls ( ) const

Returns current dump state on draw calls setting.

Returns
If dump state on draw calls is enabled, true, otherwise false.

◆ setLogging()

void kanzi::Renderer::setLogging ( bool enabled,
bool dumpStateOnDrawCalls )

Enables or disables the logging of OpenGL API calls.

Parameters
enabledWhether to enable the logging of OpenGL API calls.
dumpStateOnDrawCallsNew dump state on draw calls setting.

◆ setScreenSize()

void kanzi::Renderer::setScreenSize ( Vector2 screenSize)
inline

Sets the current screen size.

Parameters
screenSizeThe screen size in pixels.
Since
Kanzi 3.9.9

◆ getScreenSize()

Vector2 kanzi::Renderer::getScreenSize ( )
inline

Gets the current screen size.

Returns
The screen size in pixels.
Since
Kanzi 4.0.0

◆ getBlendStateCache()

BlendStateCache & kanzi::Renderer::getBlendStateCache ( )
inline

Gets the blend state cache.

Returns
Reference to the blend state cache.
Since
Kanzi 4.0.0

◆ getRasterStateCache()

RasterStateCache & kanzi::Renderer::getRasterStateCache ( )
inline

Gets the raster state cache.

Returns
Reference to the raster state cache.
Since
Kanzi 4.0.0

◆ getDepthStencilStateCache()

DepthStencilStateCache & kanzi::Renderer::getDepthStencilStateCache ( )
inline

Gets the depth stencil state cache.

Returns
Reference to the depth stencil state cache.
Since
Kanzi 4.0.0

◆ getCommandRecorder()

CommandRecorder & kanzi::Renderer::getCommandRecorder ( )
inline

Gets the command recorder.

Returns
Reference to the command recorder.
Since
Kanzi 4.0.0

◆ getRenderPassArchetypeCache()

RenderPassArchetypeCache & kanzi::Renderer::getRenderPassArchetypeCache ( )
inline

Gets the render pass archetype cache.

Returns
Reference to the render pass archetype cache.
Since
Kanzi 4.0.0

◆ getSamplerCache()

SamplerCache & kanzi::Renderer::getSamplerCache ( )
inline

Gets the sampler cache.

Returns
Reference to the sampler cache.

◆ getVertexInputStateCache()

VertexInputStateCache & kanzi::Renderer::getVertexInputStateCache ( )
inline

Gets the vertex input state cache.

Returns
Reference to the vertex input state cache.
Since
Kanzi 4.0.0

◆ getCompositionStack()

CompositionStack & kanzi::Renderer::getCompositionStack ( )
inline

Returns the render context stack.

Returns
Render context stack from renderer.
Since
Kanzi 4.0.0

◆ setSubRectangleProjection()

void kanzi::Renderer::setSubRectangleProjection ( RectangleFloat subRectangle)
inline

Enables sub-rectangle of what would be the normal projection with the given relative parameters.

Parameters
subRectangleSub-rectangle data.
Since
Kanzi 4.0.0

◆ disableSubRectangleProjection()

void kanzi::Renderer::disableSubRectangleProjection ( )
inline

Disables the sub-rectangle of projection.

Since
Kanzi 4.0.0

◆ getInheritedAspectRatioMultiplier()

float kanzi::Renderer::getInheritedAspectRatioMultiplier ( ) const
inline

Gets the multiplier to inherited aspect ratio.

Returns
Aspect ratio multiplier.
Since
Kanzi 4.0.0

◆ applyCameraMatrix()

void kanzi::Renderer::applyCameraMatrix ( Matrix4x4 cameraProjectionMatrix,
Matrix4x4 cameraViewMatrix,
float near,
float far )

Applies camera matrices to the renderer so that Kanzi can apply them as uniforms to shaders.

Parameters
cameraProjectionMatrixCamera projection matrix.
cameraViewMatrixCamera view matrix that is already inverted from the camera transform.
nearDistance to near plane.
farDistance to far plane.
Since
Kanzi 4.0.0

◆ setOverrideMaterial()

void kanzi::Renderer::setOverrideMaterial ( MaterialSharedPtr material)
inline

Sets the current override material that Kanzi uses instead of all default materials.

Setting material to nullptr disables overrides.

Parameters
materialMaterial to use as override material.
Since
Kanzi 4.0.0

◆ setOverrideMaterialCallback()

void kanzi::Renderer::setOverrideMaterialCallback ( OverrideMaterialCallback callbackFunction,
void * userData )
inline

Sets override material callback.

Pass nullptr to disable.

Parameters
callbackFunctionCallback function.
userDataUser data parameters to callback function.
Since
Kanzi 4.0.0

◆ getOverrideMaterialCallback()

OverrideMaterialCallback kanzi::Renderer::getOverrideMaterialCallback ( ) const
inline

Gets override material callback from renderer or nullptr if not enabled.

Returns
Current override material callback.
Since
Kanzi 4.0.0

◆ getOverrideMaterialCallbackUserData()

void * kanzi::Renderer::getOverrideMaterialCallbackUserData ( ) const
inline

Gets override material callback user data from renderer.

Returns
Current override material user data.
Since
Kanzi 4.0.0

◆ getOverrideClusterMaterial()

MaterialSharedPtr kanzi::Renderer::getOverrideClusterMaterial ( Node * node,
MaterialSharedPtr clusterMaterial,
size_t clusterIndex ) const

Gets overriding material for given transformed object node and cluster material.

Parameters
nodeNode to get overriding material for.
clusterMaterialCluster material to use.
clusterIndexCluster index.
Returns
Overriding material. If not overridden, can be empty.
Since
Kanzi 4.0.0

◆ beginFrame()

void kanzi::Renderer::beginFrame ( )

Begins rendering a frame, that is, clears per-frame variables.

Since
Kanzi 4.0.0

◆ endFrame()

void kanzi::Renderer::endFrame ( )

Ends rendering a frame, that is, increments frame count.

Since
Kanzi 4.0.0

◆ setColorWorkflow()

void kanzi::Renderer::setColorWorkflow ( ColorWorkflow colorWorkflow)

Sets the ColorWorkflow that has been configured.

Parameters
colorWorkflowThe project level color workflow.
Since
Kanzi 4.0.0

◆ getColorWorkflow()

ColorWorkflow kanzi::Renderer::getColorWorkflow ( ) const

Gets the currently configured ColorWorkflow.

Returns
The project level color workflow.
Since
Kanzi 4.0.0

◆ getLastFrameStatistics()

const optional< gfx::Statistics::Results > & kanzi::Renderer::getLastFrameStatistics ( )
inline

Gets the Kanzi graphics statistics for the previous frame.

Returns
The Kanzi graphics statistics if available.
Since
Kanzi 4.0.0

The documentation for this class was generated from the following file: